package com.xian.ucenter.controller.front;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xian.ucenter.commons.Result;
import com.xian.ucenter.entities.Link;
import com.xian.ucenter.entities.Project;
import com.xian.ucenter.service.impl.LinkServiceImpl;
import com.xian.ucenter.utils.PageUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@CrossOrigin
@RestController
@RequestMapping("/ucenter/front/link")
public class LinkFrontController {
    @Autowired
    private LinkServiceImpl linkService;
    @Resource
    private PageUtil<Link> linkPageUtil;
    @RequestMapping("/{current}")
    public Result getProjects(@PathVariable("current") Integer current) {
        QueryWrapper<Link> projectQueryWrapper = new QueryWrapper<>();
        return linkPageUtil.pageList(current,6,linkService,projectQueryWrapper);
    }
}
